package com.sqoq.downloader3.base_ddg

//
//import android.os.Bundle
//import android.view.LayoutInflater
//import android.view.View
//import android.view.ViewGroup
//import androidx.annotation.LayoutRes
//import androidx.databinding.DataBindingUtil
//import androidx.databinding.ViewDataBinding
//import androidx.fragment.app.Fragment
//import androidx.lifecycle.lifecycleScope
//import com.sqoq.downloader3.RepuestTool
//import kotlinx.coroutines.CoroutineScope
//import kotlinx.coroutines.Job
//
//abstract class BaseFragment_ddg<E : ViewDataBinding> : Fragment() {
//    private lateinit var view: View
//    lateinit var binding: E
//    val request: RepuestTool by lazy {
//        RepuestTool(lifecycleScope)
//    }
//    private var file16 = "dsads"
//    override fun onCreateView(
//        inflater: LayoutInflater,
//        container: ViewGroup?,
//        savedInstanceState: Bundle?
//    ): View? {
//
//        if (!this::view.isInitialized || view == null) {
//            view = layoutInflater.inflate(layout, null)
//        }
//        return view
//    }
//
//    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
//        super.onViewCreated(view, savedInstanceState)
//
//        binding = DataBindingUtil.bind(view)!!
//        init()
//
//    }
//    protected fun <T> request(
//        apiCall: suspend CoroutineScope.() -> T,
//        onStart: () -> Unit = {},
//        onSuccess: (T) -> Unit = {},
//        onError: (T) -> Unit = {},
//        onComplete: () -> Unit = {},
//        onCancel: () -> Unit = {},
//        onHttpError: (Throwable?) -> Unit = {},
//        onFinally: () -> Unit = {},
//        showLoading: Boolean = true,
//        showErrorToast: Boolean = true,
//        showHttpErrorToast: Boolean = true
//    ): Job {
//        return request.request(apiCall,onStart,onSuccess, onError, onComplete, onCancel, onHttpError, onFinally, showLoading, showErrorToast, showHttpErrorToast)
//    }
//
//
//
//    @get:LayoutRes
//    protected abstract val layout: Int
//    protected abstract fun init()
//}